home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / demos / quasrsql.zip / README.DOC < prev    next >
Text File  |  1992-01-16  |  19KB  |  394 lines

  1.  
  2.           General Information                                   Page 1 of 7
  3.  
  4.  
  5.                                Quasar SQL For Windows
  6.  
  7.                              Release 2.0 - November 1991
  8.  
  9.  
  10.                                  GENERAL INFORMATION
  11.  
  12.  
  13.                      Copyright (c) 1991-92 by Stellar Industries
  14.                                  All Rights Reserved
  15.  
  16.  
  17.           Quasar SQL For Windows release 2.0 includes a significant new
  18.           feature: the Quasar SQL Application Programming Interface (API).
  19.  
  20.           What is the Quasar SQL API?
  21.  
  22.                The Quasar SQL API is a powerful tool that enables you, the
  23.                software developer, to have full access to a modern, highly
  24.                optimized ANSI standard SQL database manager: the Quasar
  25.                Database Administrator.  Your programs written in any
  26.                language which can access dynamic link libraries can also
  27.                access the Quasar SQL API.  These languages include 'C',
  28.                'C++', 'Visual Basic', 'Pascal' and most assemblers.  In
  29.                fact, any program which can access the Microsoft Windows
  30.                environment can access the Quasar SQL API.  Microsoft
  31.                Windows itself is a dynamic link library.
  32.  
  33.                The Quasar SQL API is your gateway to modern database
  34.                technology.  With a little more than a dozen functions and
  35.                only 4 data structures you can perform almost any database
  36.                task.
  37.  
  38.           How does the Quasar SQL API work?
  39.  
  40.                "How is this done?"  you might ask.  Well, while the Quasar
  41.                Database Administrator is sophisticated, complex and fully
  42.                optimized for maximum performance: the Quasar SQL API is
  43.                simple and straight forward.  The Quasar SQL API effectively
  44.                buffers you from all the complex tasks of parsing, query
  45.                analysis, query optimization, query tree construction, etc.
  46.  
  47.           How do I link to the Quasar SQL API?
  48.  
  49.                When programming in 'C', you need to do only three things to
  50.                include all the power of SQL in your application:
  51.  
  52.                1)   When you link your object modules, include the SQL.LIB
  53.                     import library along with libw.lib.
  54.  
  55.                2)   Include the SQL.H file (e.g. "#include <sql.h>") in
  56.                     your source code.
  57.           General Information                                   Page 2 of 7
  58.  
  59.  
  60.                3)   Put the Quasar Database Administrator (DBA.EXE) and
  61.                     Quasar SQL API (SQL.DLL) someplace where windows can
  62.                     find them (usually in your windows directory).
  63.  
  64.                When programming in 'Visual Basic', you need to do only two
  65.                things to include all the power of SQL in your application:
  66.  
  67.                1)   Be sure to use the SQL.GBL file included with the
  68.                     Quasar SQL API.  Note that the 'C' style prefixes used
  69.                     with variable names (i.e. the 'n' in nResultCode, and
  70.                     the 'sz' in szErrorMessage) are not used with 'Visual
  71.                     Basic'.
  72.  
  73.                2)   Put the Quasar Database Administrator (DBA.EXE) and
  74.                     Quasar SQL API (SQL.DLL) someplace where windows can
  75.                     find them (usually in your windows directory).
  76.  
  77.           How do I use the Quasar SQL API?
  78.  
  79.                Your program can login to the Quasar Database Administrator
  80.                (SqlLogin), open a cursor (SqlCursorOpen) and execute a
  81.                query (SqlExecute).  The query itself is passed to the
  82.                Quasar SQL API as a simple text string.  The Quasar SQL API
  83.                does all the work for you.  To get your answers back (from a
  84.                SELECT statement, for example) you simply fetch them one at
  85.                a time from the Quasar SQL API.  You can fetch the first
  86.                record (SqlFetchFirst), last record (SqlFetchLast), next
  87.                record (SqlFetchNext), previous record (SqlFetchPrevious) or
  88.                even a record at a position you specify
  89.                (SqlFetchPositioned).
  90.  
  91.                You can have several cursors open at a time so that you can
  92.                access your data the way you want.
  93.  
  94.                When you're all done, close your cursors (SqlCursorClose)
  95.                and log out (SqlLogout).
  96.  
  97.           How can I check out my SQL statements?
  98.  
  99.                You can check out your SQL statements using the Quasar Query
  100.                Editor (QE.EXE) included with the Quasar SQL API.  The
  101.                Quasar Query Editor allows you to type in the query your
  102.                program is going to send to the Quasar SQL API and have it
  103.                execute right there in front of you.  You'll get all the
  104.                results back on the screen where you can verify it's what
  105.                you expected.  In fact, the Quasar Query Editor uses the
  106.                Quasar SQL API the same way your program does.
  107.  
  108.  
  109.  
  110.                        Unpacking and Installation Instructions
  111.           General Information                                   Page 3 of 7
  112.  
  113.  
  114.           Quasar SQL For Windows is provided on a single high density
  115.           diskette.  The contents of the diskette are defined in the
  116.           included PACKING.LST file.
  117.  
  118.           Efficient operation of SQL For Windows requires that you use a
  119.           disk cache manager (such as MicroSoft's SMARTDRV.SYS).  For
  120.           superior performance use a disk cache manager which also caches
  121.           disk writes, such as Norton Disk Cache (available with Norton
  122.           Utilities) or Hyperdisk Disk Accelerator (available as shareware
  123.           from HyperWare*).  We at Stellar Industries recommend Hyperdisk
  124.           Disk Accelerator with which we observe a three to six fold
  125.           performance enhancement verses SMARTDRV.SYS.  Hyperdisk is
  126.           available on many BBS's as HYDK421.ZIP.  Documentation for these
  127.           disk cache managers should be carefully reviewed.
  128.  
  129.           Adding indices to tables greatly enhances performance.  A simple
  130.           SELECT which extracts 5 records from a table of 3000 takes 10.6
  131.           seconds without an index.  The same SELECT statement takes only
  132.           0.6 seconds when there is an index on the table.
  133.  
  134.           While indices may be created at any time, we recommend that you
  135.           create indices immediately after you create their base tables,
  136.           otherwise CREATE INDEX has to read and rewrite all data which is
  137.           already in the table.
  138.  
  139.           The importance of a good disk cache manager and thoughtful
  140.           database design including the use of indices (where appropriate)
  141.           cannot be over emphasized.
  142.  
  143.           In order to properly install SQL For Windows on your computer you
  144.           will need to perform the following steps:
  145.  
  146.           1)   Use your favorite editor (NOTEPAD.EXE will suffice) to
  147.                insure that your 'CONFIG.SYS' file has the 'FILES=' MSDOS
  148.                parameter set to at least 30.
  149.  
  150.           2)   Move DBA.EXE, DBA.HLP, QE.EXE, QE.HLP, SQL.DLL SQL.HLP and
  151.                SYNTAX.HLP to the directory in which you keep windows
  152.                programs.  This is usually the 'c:\windows' directory.
  153.  
  154.           3)   Make two new directories.  One will be for the Quasar
  155.                Database Administrator's files (we recommend naming it
  156.                'database'), the other will be for your queries and data (we
  157.                recommend naming it 'data').  You can use the MS-DOS 'mkdir'
  158.                command to do this.
  159.  
  160.           4)   Move the *.SQL and *.DAT files to where you want to keep
  161.                your queries.  These files contain both sample queries and
  162.                an import file to load some sample data into the database.
  163.                We recommend putting these files in your 'data' directory.
  164.           ____________________
  165.  
  166.           *  HyperWare, RR#1 Box 91, Pall Mall, TN 38577; voice: (615) 864-
  167.           6868; BBS: 8N1 (HST, V.32, V.22bis): (615) 864-6871
  168.           General Information                                   Page 4 of 7
  169.  
  170.  
  171.           5)   Use your favorite editor (NOTEPAD.EXE will suffice) to
  172.                modify the windows initialization file WIN.INI.  This file
  173.                can usually be found in the 'c:\windows' directory.  Add the
  174.                following lines:
  175.  
  176.                     [QuasarDba]
  177.                     AutoStart=1
  178.                     DatabasePath=c:\database
  179.                     DataFilePath=c:\data
  180.                     FileNameDatabaseDump=c:\temp\quasar.dmp
  181.  
  182.                     [QuasarQe]
  183.                     Acknowledge=1
  184.                     DataFilePath=c:\data
  185.                     OpenNew=1
  186.                     UserName=SYSTEM
  187.                     UserPassword=QUASAR
  188.                     WarnOnClose=1
  189.  
  190.                As DBA.EXE and QE.EXE automatically add some of these lines
  191.                if they do not already exist, be sure you are not adding
  192.                duplicate entries.  If you edit WIN.INI before running
  193.                DBA.EXE or QE.EXE you don't have to worry.
  194.  
  195.                These entries have the following meanings:
  196.  
  197.                [QuasarDba]         Identifies a block of entries as
  198.                                    belonging to the Quasar Database
  199.                                    Administrator.
  200.  
  201.                AutoStart           Set to '0' or '1'. When set to '1'
  202.                                    causes the Quasar Database Administrator
  203.                                    to automatically start the database as
  204.                                    soon as you start the program.
  205.  
  206.                DatabasePath        Set to the path you want the database
  207.                                    files to reside in.  Make sure to create
  208.                                    this directory before starting the
  209.                                    Quasar Database Administrator.  We
  210.                                    recommend naming it 'database'.
  211.  
  212.                DatafilePath        Set to the path you want to use as the
  213.                                    default for import and export
  214.                                    operations.  We recommend naming it
  215.                                    'data'.
  216.  
  217.                FileNameDatabaseDump     Set to the full file name of the
  218.                                    file you want the Quasar Database
  219.                                    Administrator to use for the 'dump'
  220.                                    operation.
  221.  
  222.                LogPath             Set to the path you want the transaction
  223.                                    journal files to reside in.  Make sure
  224.                                    to create this directory before starting
  225.           General Information                                   Page 5 of 7
  226.  
  227.  
  228.                                    the Quasar Database Administrator.  If
  229.                                    not specified, DatabasePath is used.  We
  230.                                    recommend letting it default to
  231.                                    DatabasePath.
  232.  
  233.                [QuasarQe]          Identifies a block of entries as
  234.                                    belonging to the Quasar Query Editor.
  235.  
  236.                Acknowledge         Set to '0' or '1'. When set to '1'
  237.                                    causes the Quasar Query Editor to
  238.                                    display an informational dialog box
  239.                                    every time a query completes.
  240.  
  241.                DataFilePath        Set to the path you want to use as the
  242.                                    default for file operations.  We
  243.                                    recommend naming it 'data'.
  244.  
  245.                OpenNew             Set to '0' or '1'. When set to '1'
  246.                                    causes the Quasar Query Editor to
  247.                                    automatically create a new 'pad' when
  248.                                    the Query Editor first starts.
  249.  
  250.                UserName            Set to 'SYSTEM'.  This identifies the
  251.                                    default user name.
  252.  
  253.                UserPassword        Set to 'QUASAR'.  This identifies the
  254.                                    default user password.
  255.  
  256.                WarnOnClose         Set to '0' or '1'. When set to '1'
  257.                                    causes the Quasar Query Editor to prompt
  258.                                    the user for a file name before closing
  259.                                    a pad which contains text not yet saved
  260.                                    to disk.
  261.  
  262.                SQL For Windows also relies upon the international date and
  263.                time settings.  The Windows defaults are fine and you can
  264.                leave them alone.  If you've changed them, don't worry, time
  265.                stamps are saved in binary and not converted to
  266.                international format until used for output.  If you're
  267.                interested, we recommend the following settings:
  268.  
  269.                     [intl]
  270.                     iDate=0
  271.                     iTime=0
  272.                     iTLZero=1
  273.                     s1159=AM
  274.                     s2359=PM
  275.                     sDate=/
  276.                     sShortDate=MM/dd/yy
  277.                     sTime=:
  278.  
  279.                International date and time settings are most easily changed
  280.                via Microsoft's Windows Control Panel.  Select the
  281.                "International" icon then click on either "date" or "time".
  282.           General Information                                   Page 6 of 7
  283.  
  284.  
  285.           6)   Use Microsoft's Program Manager to create a new program
  286.                group:
  287.  
  288.                a) select 'File', 'New'
  289.  
  290.                b) select 'Program Group', 'OK'
  291.  
  292.                c) Enter description: 'Quasar', group file: 'QUASAR'
  293.  
  294.                d) select 'OK'
  295.  
  296.           7)   Use Microsoft's Program Manager to create two new program
  297.                items:
  298.  
  299.                a) select 'File', 'New'
  300.  
  301.                b) select Program Item, 'OK'
  302.  
  303.                c) Enter description: 'Dba', command line: 'DBA.EXE'
  304.  
  305.                d) select 'OK'
  306.  
  307.                e) select 'File', 'New'
  308.  
  309.                f) select Program Item, 'OK'
  310.  
  311.                g) Enter description: 'Qe', command line: 'QE.EXE'
  312.  
  313.                h) select 'OK'
  314.  
  315.           8)   Start the Quasar Database Administrator by clicking on the
  316.                'Dba' Icon in the Microsoft Program Manager.  When the
  317.                Quasar Database Administrator complains that it can't find a
  318.                database, click on "OK".  Now select 'Toolbox' in the main
  319.                menu.  Select the 'Install' entry, this will install the
  320.                database in the directory identified by the 'DatabasePath'
  321.                setting described above.
  322.  
  323.           9)   At this point the database is fully installed.  To run some
  324.                sample queries, see the section "Example Queries" below.
  325.  
  326.           10)  If you're not going to use the Quasar SQL Applications
  327.                Programming Interface (API), you may exit ('Exit' is in the
  328.                'File' menu) the Quasar Database Administrator.
  329.  
  330.           11)  If you intend to use the Quasar SQL API for 'C' program
  331.                development:  Move SQL.LIB into some directory where it is
  332.                accessible by your linker (usually c:\windev\lib).  Move
  333.                SQL.H to a directory where it is accessible to the compiler
  334.                (usually c:\c\include).  You will probably want to read
  335.                SQL.DOC.  A sample application program is included as
  336.                EXAMPLEC.*.  You ought to compile, link and run it (the
  337.                batch file EXAMPLEC.BAT is included to accomplish this) to
  338.                familiarize yourself with the Quasar SQL API.
  339.           General Information                                   Page 7 of 7
  340.  
  341.  
  342.           12)  If you intend to use the Quasar SQL API for 'Visual Basic'
  343.                program development:  A sample application program is
  344.                included.  Move EXAMBLEB.* to a directory where you keep
  345.                your 'Visual Basic' programs (usually c:\vb).  You ought to
  346.                compile and run EXAMPLEB to familiarize yourself with the
  347.                Quasar SQL API.  You will probably want to read SQL.DOC.
  348.  
  349.  
  350.  
  351.                                    Example Queries
  352.  
  353.  
  354.           You will probably want to run our examples to familiarize
  355.           yourself with the operation of SQL For Windows.
  356.  
  357.           1)   Start the Quasar Database Administrator by clicking on the
  358.                'Dba' Icon in the Microsoft Program Manager.  The database
  359.                ought to start automatically.  If you didn't set AutoStart=1
  360.                in the WIN.INI file, when the Quasar Database
  361.                Administrator's window appears select 'Control' from its
  362.                menu.  Select the 'Start' entry, this will start the
  363.                database.
  364.  
  365.           2)   Start the Quasar Query Editor by clicking on the 'Qe' icon
  366.                in the Microsoft Program Manager.  When the Quasar Query
  367.                Editor's window appears select 'File' from its menu.  Now
  368.                select the 'Open' entry and open the file CREATE.SQL.  When
  369.                its text appears in a pad select the menu commands
  370.                'Database', 'Execute' (or hit control/x).  This query
  371.                creates the tables of the example database.
  372.  
  373.           3)   Now go to the Quasar Database Administrator and select the
  374.                menu commands 'File', 'Import'.  Select the file
  375.                EXAMPLE.DAT.  The 'Import' loads the data in EXAMPLE.DAT
  376.                into the tables you created with CREATE.SQL.
  377.  
  378.           4)   You can now execute any of the sample queries.  Go to the
  379.                Quasar Query Editor, open a file (for example QUERY01.SQL)
  380.                and execute it.  Files which contain select statements will
  381.                cause the Quasar Query Editor to open a new pad and place
  382.                the results as text into the new pad.  You may then edit the
  383.                data and/or save it to a file using the 'File', 'Save As'
  384.                commands.
  385.  
  386.           5)   To remove the sample data from the database just execute the
  387.                SQL 'drop table' statements in the DROP.SQL file.
  388.  
  389.           6)   You are now ready to write your own SQL statements and
  390.                create your own database.
  391.  
  392.           Stellar Industries:      (714) 861-7885
  393.                                    3335 S. Falcon Ridge Road
  394.                                    Diamond Bar, CA  91765